export interface UserInfo {
  id: string
  username: string
  phone: string | null
  balance: number
  status: number
  createTime: string
  updateTime: string
}

export interface LoginResult {
  token: string
  userId: string
  username: string
  roles: string[]
  permissions: string[]
}

// 定义路由元数据类型
export interface RouteMeta {
  title?: string
  icon?: string
  permission?: string
}

// 定义 store 的状态类型
export interface UserState {
  token: string
  userInfo: UserInfo | null
  permissions: string[]
  roles: string[]
}

// 定义 store 的 actions 类型
export interface UserStore {
  // State
  token: string
  userInfo: UserInfo | null
  permissions: string[]
  roles: string[]
  
  // Actions
  setToken(token: string): void
  setUserInfo(info: LoginResult): void
  getUserInfo(): Promise<UserInfo>
  clearUserData(): void
}
